<?php
$v_page = $_SESSION['v_session_page'];
$v_limit_row = $_SESSION['v_session_limit_num_page'];
$v_current_status = ($arr_single_record['C_CURRENT_STATUS']);
$v_detail_status = intval($arr_single_record['C_DETAIL_STATUS']);
// Luu ten style hien thoi
$v_current_style_name = "odd_row";
// Luu ten style tiep theo
$v_next_style_name = "";
$v_staff_id = _get_item_attr_by_id ($_SESSION['arr_all_staff'],$_SESSION['staff_id'],'id');
$v_recordtype_filter = $_SESSION['onegate_current_recordtype'];
for($i=0;$i<sizeof($arr_all_recordtype);$i++){
	if ($arr_all_recordtype[$i]['C_NAME'] == $v_recordtype_filter){
		$v_recordtype_id = $arr_all_recordtype[$i]['PK_RECORDTYPE'];
	}
}

//Kiem tra NSD hien thoi dong vai tro la can bo tiep nhan doi voi loai ho so tuong ung va trang thai cua ho so la "DANG_THU_LY" va C_DETAIL_STATUS <>20
if ((onegate_is_receiver_for_recordtype($v_staff_id,$v_recordtype_id,$_SESSION["recordtype"])) && $v_current_status == "DANG_THU_LY" && $v_detail_status <> 20 ){
	$v_is_receiver_for_recordtype_and_status = 1;
}else{
	$v_is_receiver_for_recordtype_and_status = 0;
}
//Kiem tra NSD hien thoi dong vai tro la lanh dao phu trach duyet ho so lan thu nhat khong?
if ((onegate_is_handler_leader_first_time_for_recordtype($v_staff_id,$v_recordtype_id,$_SESSION["recordtype"])) && $v_current_status == "TRINH_KY" && $v_detail_status == 23 ){
	$v_is_handler_leader_first_time_for_recordtype_and_status = 1;
}else{
	$v_is_handler_leader_first_time_for_recordtype_and_status = 0;
}
//Kiem tra NSD hien thoi dong vai tro la lanh dao phu trach thu ly ho so doi voi loai ho so tuong ung va trang thai cua ho so la "TRINH_KY" va C_DETAIL_STATUS ==30
if ((onegate_is_handler_leader_for_recordtype($v_staff_id,$v_recordtype_id,$_SESSION["recordtype"])) && $v_current_status == "TRINH_KY" && $v_detail_status == 30 ){
	$v_is_handler_leader_for_recordtype_and_status = 1;
}else{
	$v_is_handler_leader_for_recordtype_and_status = 0;
}
//Kiem tra NSD hien thoi dong vai tro la lanh dao phu trach phe duyet ho so doi voi loai ho so tuong ung va trang thai cua ho so la "TRINH_KY" va C_DETAIL_STATUS ==40
if ((onegate_is_approve_leader_for_recordtype($v_staff_id,$v_recordtype_id,$_SESSION["recordtype"])) && $v_current_status == "TRINH_KY" && $v_detail_status == 40 ){
	$v_is_approve_leader_for_recordtype_and_status = 1;
}else{
	$v_is_approve_leader_for_recordtype_and_status = 0;
}
//Kiem tra NSD hien thoi dong vai tro la thu ly chinh hoac nguoi phoi hop thu ly doi voi ho so hien thoi va trang thai cua ho so la "DANG_THU_LY" va C_DETAIL_STATUS <>20
if ( ((onegate_is_main_handler_for_record($v_staff_id,$v_record_id))|| (onegate_is_co_handler_for_record($v_staff_id,$v_record_id)) )&&  $v_current_status == "DANG_THU_LY" && $v_detail_status <> 20){
	$v_is_main_or_co_handler_for_record_and_status = 1;
}else{
	$v_is_main_or_co_handler_for_record_and_status = 0;
}
// Nhung ho so trinh lanh dao sau do lanh dao xem xet roi cap nhat option "Chuyen co quan co tham quyen giai quyet" thi truong hop sau
// se xay ra
$v_permisstion_update_idea = 0;
if(
		onegate_is_main_handler_for_record($v_staff_id,$v_record_id)
		&& ($v_detail_status = 70)
   ){
   		$v_permisstion_update_idea = 1;
   }
# echo 'v_permisstion_update_idea' . $v_permisstion_update_idea;
?>
<!--bang chua tieu de cua form-->
<table width="100%" cellpadding="0" cellspacing="0">
	<tr class="normal_title">
		<td>
			<?php echo $v_title; ?>
			<a id="goto" href="" style=".color:white">#</a>
		</td>
	</tr>
</table>
<!-- bang chua cac tieu thuc loc-->
<table class="form_table1" cellpadding="0" cellspacing="0" width="100%">								
	<tr>
	 	<form action="index.php" name="frm_dsp_all_idea" method="post">
		<input type="hidden" name="hdn_idea_id"  value="<?php echo $v_idea_id; ?>">
		<input type="hidden" name="hdn_record_id"  value="<?php echo $v_record_id; ?>">
		<input type="hidden" name="hdn_recordtype_filter" value="<?php echo $v_recordtype_filter; ?>">
		<input type="hidden" name="fuseaction"  value="">
		<input type="hidden" name="hdn_list_id"  value="">
		<input type='hidden' name='hdn_page' value='<?php echo $v_page;?>'>
		<input type='hidden' name='hdn_record_number_page' value='<?php echo $v_limit_row;?>'>
	</tr>
	<tr >
		<td colspan="10" >
		<?php 
		//////		
		$date =date("d/m/Y");
		$strHTML = "";
		$strHTML = $strHTML . "<table width='99%' cellpadding='0' cellspacing='0'>";
		$strHTML = $strHTML . "<col width='25%'><col width='75%'>";
		$strHTML = $strHTML . "<tr>";
		$strHTML = $strHTML . "<td class='normal_label'>Lo&#7841;i h&#7891; s&#417;</td>";
		$strHTML = $strHTML . "<td class='normal_label' colspan='3'>$v_recordtype_name2</td>";
		$strHTML = $strHTML . "</tr>";
		$strHTML = $strHTML . "<tr>";
		$strHTML = $strHTML . "<td class='normal_label'>"._CONST_RADIO_LABEL_NOTIFY_DSHS."</td>";
		$strHTML = $strHTML . "<td class='normal_label' colspan='3'>$v_c_code</td>";
		$strHTML = $strHTML . "</tr>";
		$strHTML = $strHTML . "<tr>";
		$strHTML = $strHTML . "<td class='normal_label'>"._CONST_RADIO_LABEL_NOTIFY_NGAY_TH."</td>";
		$strHTML = $strHTML . "<td class='normal_label' colspan='3'><input type='text' value='$date' size=12/></td>";
		$strHTML = $strHTML . "</tr>";
		$strHTML = $strHTML . "<tr>";
		$strHTML = $strHTML . "<td class='normal_label' valign='top'>"._CONST_RADIO_LABEL_NOTIFY_KQ_TL."</td>";
		$strHTML = $strHTML . "<td class='normal_label' colspan='3'><input type='radio' name='thong_bao'/>"._CONST_RADIO_LABEL_NOTIFY_THUE."<br/><input type='radio' name='thong_bao'/>"._CONST_RADIO_LABEL_NOTIFY_PHAT."</td>";
		$strHTML = $strHTML . "</tr>";
		$strHTML = $strHTML . "<tr>";
		$strHTML = $strHTML . "<td class='normal_label'>"._CONST_RADIO_LABEL_NOTIFY_LY_DO."</td>";
		$strHTML = $strHTML . "<td class='normal_label' colspan='3'><textarea name='ly_do_thue' style='width:100%'></textarea></td>";
		$strHTML = $strHTML . "</tr>";
		$strHTML = $strHTML . "</table>";
		echo $strHTML; ?>
		
		</td>
	</tr>
	<!--
	<tr>
		<td align="left" class="small_label">
	  		<small class="small_starmark"><?php echo CONST_RECORD_LIST_HAS_LABEL . $v_count_idea .  CONST_IDEA_LABEL;?></small>
	  	</td>
	</tr>-->
</table>


<table width="100%" >
	<tr>
		<td align="center" width="100%" height="40" valign="bottom"><?php
			if ($v_record_work_id <=0){?>
			<input type="button" name="btn_save"  class="normal_button" value="<?php echo _CONST_SAVE_BUTTON;?>" onClick="btn_save_process_onclick('004','<?php echo date("d/m/Y");?>',document.forms(0).txt_date);" onKeyDown="change_focus(document.forms(0),this)"><?php
			}?>
			<input type="button" name="btn_back" class="normal_button" value="<?php echo _CONST_BACK_BUTTON;?>" onClick="btn_back_onclick('<?php echo $_GO_BACK?>')" onKeyDown="change_focus(document.forms(0),this)">
		</td>
	</tr>
</table>
</form>